package com.bupt.server;

import com.bupt.server.entity.Room;
import com.bupt.server.obj.PublicData;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan("com.bupt.server.mapper")
public class ServerApplication {

    public static void main(String[] args) {
        ////
        Room room1 = new Room();
        room1.setRoom_id(1);
        room1.setSpeed("medium");
        room1.setCurrent_temperature(10);
        room1.init_temperature = 10;
        room1.setAc_status("off");
        room1.setStatus(false);
        room1.setTotal_air_cost(0);
        room1.setTotal_cost(0);
        Room room2 = new Room();
        room2.setRoom_id(2);
        room2.setSpeed("medium");
        room2.setCurrent_temperature(15);
        room2.init_temperature = 15;
        room2.setAc_status("off");
        room2.setStatus(false);
        room2.setTotal_air_cost(0);
        room2.setTotal_cost(0);
        Room room3 = new Room();
        room3.setRoom_id(3);
        room3.setSpeed("medium");
        room3.setCurrent_temperature(18);
        room3.init_temperature = 18;
        room3.setAc_status("off");
        room3.setStatus(false);
        room3.setTotal_air_cost(0);
        room3.setTotal_cost(0);
        Room room4 = new Room();
        room4.setRoom_id(4);
        room4.setSpeed("medium");
        room4.setCurrent_temperature(12);
        room4.init_temperature = 12;
        room4.setAc_status("off");
        room4.setStatus(false);
        room4.setTotal_air_cost(0);
        room4.setTotal_cost(0);
        Room room5 = new Room();
        room5.setRoom_id(5);
        room5.setSpeed("medium");
        room5.setCurrent_temperature(14);
        room5.init_temperature = 14;
        room5.setAc_status("off");
        room5.setStatus(false);
        room5.setTotal_air_cost(0);
        room5.setTotal_cost(0);
        PublicData.totalRoomList.put(1,room1);
        PublicData.totalRoomList.put(2,room2);
        PublicData.totalRoomList.put(3,room3);
        PublicData.totalRoomList.put(4,room4);
        PublicData.totalRoomList.put(5,room5);
        PublicData.resetRoom("cold",1);
        PublicData.resetRoom("cold",2);
        PublicData.resetRoom("cold",3);
        PublicData.resetRoom("cold",4);
        PublicData.resetRoom("cold",5);
        PublicData.temp="cold";

        ////
        SpringApplication.run(ServerApplication.class, args);
    }

}
